package com.an.dao;

import com.an.domain.LoginLog;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Repository;

@Repository
public class LoginLogDao {

    @Autowired
    private JdbcTemplate jdbcTemplate;

    public void insertIntoLoginLog(LoginLog loginLog){
        System.out.println(loginLog);
        if(loginLog != null)
        jdbcTemplate.update("insert into t_login_log(user_id,ip,login_datatime) VALUES (?,?,?) ",new Object[]{loginLog.getUserId(),loginLog.getIp(),loginLog.getLoginDate()});
    }
}
